home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / e / rpmod1v1.lha / Modules / Tools / qsortUL.doc < prev    next >
Encoding:
Text File  |  1995-04-06  |  1.3 KB  |  59 lines

  1.  
  2.     Optimised QuickSort of ARRAY OF LONG ( qsortUL.m )
  3.  
  4.     © Richard Perrott 4th April 1995 FreeWare
  5.       email: hcm94rp2@dmu.ac.uk
  6.  
  7.  
  8.   This is a module containing a heavily optimised Quicksort routine
  9. for ARRAY OF LONG ( unsigned values ), it sort the array in accending
  10. order.
  11.  
  12.   There are 3 ways to call the routine:
  13.  
  14.   1.
  15.     by direct machine code access to the core routine,
  16.     pass two registers to it.
  17.  
  18.         A0 =  the start address of array
  19.         A1 =  the end address of array
  20.  
  21.         BSR    qsortUL_mc
  22.  
  23.           or
  24.  
  25.         JSR    qsortUL_mc
  26.  
  27.  
  28.   2.
  29.     by calling a PROC with the start and end address
  30.     of the array.
  31.  
  32.         PROC qsortUL(first_p,last_p)
  33.  
  34.   3.
  35.     by calling a PROC with the base address of array,
  36.     a start index and an end index.
  37.  
  38.         PROC qsortULi(base_p,first,last)
  39.  
  40.  
  41. Note:
  42.   All 3 methods save any registers they use, the only exception is
  43. A0 and A1 for qsortUL_mc.
  44.  
  45.   The module contains 184 bytes of assembler / E code and embedded
  46.   copyright, please do not try to remove or reverse engineer.
  47.  
  48.   The routine has been heavily tested, though there are no promises
  49. and I won't be held responsible if you find bugs or you misuse the
  50. routines.
  51.  
  52.   If you do find any bugs then please email me.
  53.  
  54. References:
  55.     Programming and Problem Solving in Modula-2, Sanford Leestma
  56.     & Larry Nyhoff, © Macmillan 1992, USA, page 624-626
  57.  
  58.     ( beware the example in this book for Split() contains some bugs )
  59.